package easy

import (
	"workspace/node"
)

func SearchBST(root *node.TreeNode, val int) *node.TreeNode {
	if root == nil {
		return nil
	}
	if root.Val == val {
		return root
	}
	if root.Val > val {
		return SearchBST(root.Left, val)
	}
	return SearchBST(root.Right, val)

}
